<?php if ($this->pageCount > 1): ?>
    <div class="pagination">
        <ul>
            <?php if (isset($this->previous)): ?>
                <li class="prev"><a href="<?php echo $this->url(array('page' => $this->previous), $this->route, false); ?>">&laquo;</a></li>
            <?php else: ?>
                <li class="prev disabled"><a href="#">&laquo;</a></li>
            <?php endif; ?>

            <?php foreach ($this->pagesInRange as $page): ?>
                <?php if ($page == $this->current): ?>
                    <li class="active"><a href="#"><?php echo $page ?></a></li>
                <?php else: ?>
                    <li><a href="<?php echo $this->url(array('page' => $page), $this->route, false); ?>"><?php echo $page; ?></a></li>
                <?php endif; ?>
            <?php endforeach; ?>

            <?php if (isset($this->next)): ?>
                <li class="next"><a href="<?php echo $this->url(array('page' => $this->next), $this->route, false); ?>">&raquo;</a></li>
            <?php else: ?>
                <li class="next disabled"><a href="#">&raquo;</a></li>
            <?php endif; ?>
        </ul>
    </div>
<?php endif;?>